
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>ScoreCardModel.binning package &#8212; ScoreCardModel  documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head>
  <body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="scorecardmodel-binning-package">
<h1>ScoreCardModel.binning package<a class="headerlink" href="#scorecardmodel-binning-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-ScoreCardModel.binning.discretization">
<span id="scorecardmodel-binning-discretization-module"></span><h2>ScoreCardModel.binning.discretization module<a class="headerlink" href="#module-ScoreCardModel.binning.discretization" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id1">
<h3>离散化连续数据<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<p>我们使用pandas来对连续数据做离散化处理.其接口尽量与sklearn的数据预处理模块接近.</p>
<div class="section" id="id2">
<h4>使用方法:<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h4>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">d</span> <span class="o">=</span> <span class="n">Discretization</span><span class="p">([</span><span class="mi">0</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">4</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">list</span><span class="p">(</span><span class="n">d</span><span class="o">.</span><span class="n">transform</span><span class="p">([</span><span class="mf">0.5</span><span class="p">,</span><span class="mf">1.5</span><span class="p">,</span><span class="mf">2.5</span><span class="p">,</span><span class="mf">3.5</span><span class="p">]))</span>
<span class="go">[&#39;(0, 2]&#39;, &#39;(0, 2]&#39;, &#39;(2, 4]&#39;, &#39;(2, 4]&#39;]</span>
</pre></div>
</div>
<dl class="class">
<dt id="ScoreCardModel.binning.discretization.Discretization">
<em class="property">class </em><code class="descclassname">ScoreCardModel.binning.discretization.</code><code class="descname">Discretization</code><span class="sig-paren">(</span><em>bins</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ScoreCardModel/binning/discretization.html#Discretization"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ScoreCardModel.binning.discretization.Discretization" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>离散化连续数据.需要实例化以保存bins状态.</p>
<dl class="attribute">
<dt id="ScoreCardModel.binning.discretization.Discretization.bins">
<code class="descname">bins</code><a class="headerlink" href="#ScoreCardModel.binning.discretization.Discretization.bins" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Sequence</em> –</p>
<ul class="simple">
<li>用于分段的列表,第一位为下限,最后一位为上限</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="ScoreCardModel.binning.discretization.Discretization.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ScoreCardModel/binning/discretization.html#Discretization.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ScoreCardModel.binning.discretization.Discretization.transform" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>x</strong> (<em>Sequence</em>) – <ul class="simple">
<li>用于分段的序列</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><ul class="simple">
<li>以分段字符串为枚举内容的numpy序列</li>
</ul>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">np.array</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
</div>
</div>
<div class="section" id="module-ScoreCardModel.binning">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-ScoreCardModel.binning" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id3">
<h3>分箱算法<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3>
<p>处理连续数据</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">ScoreCardModel.binning package</a><ul>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#module-ScoreCardModel.binning.discretization">ScoreCardModel.binning.discretization module</a><ul>
<li><a class="reference internal" href="#id1">离散化连续数据</a><ul>
<li><a class="reference internal" href="#id2">使用方法:</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#module-ScoreCardModel.binning">Module contents</a><ul>
<li><a class="reference internal" href="#id3">分箱算法</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
  </ul></li>
</ul>
</div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/ScoreCardModel.binning.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2017, 87.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.5</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
      
      |
      <a href="_sources/ScoreCardModel.binning.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>